Skip to content

Rsdk-13773: viam generate app command #5950

Draft
allisonschiang wants to merge 40 commits intoviamrobotics:mainfrom
allisonschiang:RSDK-13773
Draft

Rsdk-13773: viam generate app command #5950
allisonschiang wants to merge 40 commits intoviamrobotics:mainfrom
allisonschiang:RSDK-13773

Conversation

@allisonschiang
Copy link
Copy Markdown
Member

@allisonschiang allisonschiang commented Apr 20, 2026

This PR adds app generation to the existing viam module generate command. The implementation is straightforward: a new huh form collects app-specific inputs(I split the form into module only forms, app only forms, then shared forms that run if you generate both), then templates (mostly adapted from the https://github.com/viamrobotics/sanding-webapp repo) are rendered into a project directory. I also added tests so if anything gets changed that breaks the webapp module, the tests should fail.

Tested:

  • huh form generates module for app, module, and app+module
  • generated project for app builds (make setup and make succeed)
  • When pointing machine to a local module, the localhost page is served the credentials to connect
  • uploading a webapp module to registry creates a viam-hosted app
  • single vs multi machine selection (it just fills out the meta.json field)
  • app+module generation support
  • local server works via cloud signaling, over network, and with no internet (need viam-server 8081 config)
  • add auth.ts file and document in readme

To do:

  • improve readme
  • test!!!

Future Additions (maybe after this eng cycle?)

  1. Local server for Python/C++ modules
  2. Bubbletea dynamic forms (replace huh static forms)
  3. webapp viamapplication link on machine page (its currently only on the module in registry)

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Apr 20, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 21, 2026
Comment thread cli/module_generate/_templates/app/tmpl-module.go
@stuqdog
Copy link
Copy Markdown
Member

stuqdog commented Apr 21, 2026

`What doesn't work:

local server - could not access the :8888 from my phone on the same address`

I may be misunderstanding but this seems normal and expected? if it's a localhost address then it stands to reason that it wouldn't be accessible from a separate device.

@allisonschiang
Copy link
Copy Markdown
Member Author

`What doesn't work:

local server - could not access the :8888 from my phone on the same address`

I may be misunderstanding but this seems normal and expected? if it's a localhost address then it stands to reason that it wouldn't be accessible from a separate device.

I assumed local server meant :8888 like 10.2.3.111:8888 and then if you enable it then anything on the same network your machine is running on (with the module) should be able to access the site

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 21, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 21, 2026
Replace inlined HTTP server + cookie injection code with
github.com/erh/vmodutils.NewWebModuleAndStart(). The vmodutils
package is actively maintained and handles the server lifecycle.

make setup fetches the latest vmodutils version via go get.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 21, 2026
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Apr 21, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 22, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants